package com.ai.controller.made;


import com.ai.annotation.EnterPathParamLog;
import com.ai.common.CommonResponse;
import com.ai.entity.cameraFunctions.CameraFunctionID;
import com.ai.entity.made.RegionBase;
import com.ai.entity.made.page.OpcServerInfoPage;
import com.ai.entity.made.page.RegionPage;
import com.ai.model.dto.OpcServerInfoDto;
import com.ai.model.param.PlcLogsParams;
import com.ai.service.made.IOpcServerInfoService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * opc  server
 * @author jiaok
 * @since 2024-11-14
 */
@RestController
@RequestMapping("/opc-server-info")
public class OpcServerInfoController {


    @Autowired
    private IOpcServerInfoService iOpcServerInfoService;


    @ApiOperation("新增opc服务")
    @PostMapping("add")
    @EnterPathParamLog
    public CommonResponse<String> add(@RequestBody  OpcServerInfoDto opcServerInfoDto){
        return iOpcServerInfoService.add(opcServerInfoDto);
    }

    @ApiOperation("删除opc服务")
    @PostMapping("delete/{id}")
    @EnterPathParamLog
    public CommonResponse<String> delete(@PathVariable(value = "id") String id ){
        return iOpcServerInfoService.delete(id);
    }

    @ApiOperation("修改opc服务")
    @PostMapping("edit")
    @EnterPathParamLog
    public CommonResponse<String> edit(@RequestBody  OpcServerInfoDto opcServerInfoDto){
        return iOpcServerInfoService.edit(opcServerInfoDto);
    }


    @ApiOperation("opc设备分页")
    @PostMapping("pageList")
    @EnterPathParamLog
    public IPage selectByPage(@RequestBody OpcServerInfoPage page) {
       return   iOpcServerInfoService.selectByPage(page);
    }


    @ApiOperation("获取所有的opcServer名称")
    @PostMapping("getOpcServerNameList")
    @EnterPathParamLog
    public CommonResponse getOpcServerNameList(){
        return iOpcServerInfoService.getOpcServerNameList();
    }




}
